import logging
from datetime import timedelta


class Config:
    SECRET_KEY = "c_prok_2025"
    TOKEN_NAME = "authz"
    # Session 设置
    PERMANENT_SESSION_LIFETIME = timedelta(days=7)

    SESSION_TYPE = "filesystem"  # 默认使用文件系统来保存会话
    SESSION_PERMANENT = False  # 会话是否持久化
    SESSION_USE_SIGNER = True  # 是否对发送到浏览器上 session 的 cookie 值进行加密

    # 默认日志等级
    LOG_LEVEL = logging.WARN


swagger_config = {
    "headers": [
    ],
    "specs": [
        {
            "endpoint": 'apispec',
            "route": '/apispec.json',
            "rule_filter": lambda rule: True,
            "model_filter": lambda tag: True,
        }
    ],
    "static_url_path": "/flasgger_static",
    "swagger_ui": True,
    "specs_route": "/apidocs/"
}

swagger_template = {
    "swagger": "2.0",
    "info": {
        "title": "API Test",
        "description": "Restful API Test",
        "version": "1.0.0"
    },

}

database_config = {
    'JSON_AS_ASCII': False,
    'SQLALCHEMY_DATABASE_URI': 'mysql+mysqlconnector://root:c_prok_2025@8.155.54.207/c_prok_data',
    'SQLALCHEMY_TRACK_MODIFICATIONS': False
}
